import { createApp } from 'vue'
import App from './App.vue'
import router from './router/index.js'
import store from './store/index.js'
import {getdata,execdata} from './utils/ljxdata.js';


const app = createApp(App);
//全局函数挂载
app.config.globalProperties.getdata = getdata;
app.config.globalProperties.execdata = execdata;

app.use(router);
app.use(store);

// 从 sessionStorage 刷新恢复登录状态
const isLogin = sessionStorage.getItem('isLogin') === 'true';
const loginName = sessionStorage.getItem('loginName') || '未登录';
if (isLogin) {
    store.commit('login', loginName);
}

app.mount('#app');
